package weather.language;

import java.util.Date;


public class WhereAndWhen
{	
	public WhereAndWhen(Site where, Date when)
	{
		this.where = where;
		this.when = when;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((when == null) ? 0 : when.hashCode());
		result = prime * result + ((where == null) ? 0 : where.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		
		WhereAndWhen other = (WhereAndWhen) obj;
		
		if (when == null)
		{
			if (other.when != null)
				return false;
		}
		else if (!when.equals(other.when))
			return false;
		
		if (where == null)
		{
			if (other.where != null)
				return false;
		}
		else if (!where.equals(other.where))
			return false;
		
		return true;
	}
	
	public Site getWhere()
	{
		return where;
	}
	
	public Date getWhen()
	{
		return when;
	}
	
	private Site where;
	private Date when;
}
